package com.yt.app.provider.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.yt.app.core.interfaces.AppIconService;
import com.yt.app.core.model.AppIcon;
import com.yt.app.provider.dao.AppIconDao;
import com.yt.core.dao.filter.DynamicSQLFilterImpl;
import com.yt.core.dao.filter.QueryFilter;
import com.yt.core.service.GenericServiceImpl;
import org.springframework.stereotype.Component;

import java.util.List;

public class AppIconServiceImpl extends GenericServiceImpl<AppIcon, Long> implements AppIconService {
	private AppIconDao dao;

	public AppIconServiceImpl() {
	}

	public AppIconServiceImpl(AppIconDao dao) {
		super(dao);
		this.dao = dao;
	}

	public List<AppIcon> findByType(Integer type){
		QueryFilter queryFilter = new DynamicSQLFilterImpl();
		queryFilter.addFilter("Q_type_N_EQ", type.toString());
		queryFilter.setSortField("sort", true);
		return this.dao.find(queryFilter);
	}

}
